﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Castle.Core.Interceptor;
using Common.Logging;

namespace Harkon.AppServer.cOne.Registry
{
    public class RegistryProxy : IInterceptor
    {
        private static ILog logger = LogManager.GetLogger(typeof(RegistryProxy));
        public IRegistry ServiceRegistry { get; set; }

        public void Intercept(IInvocation invocation)
        {
            if (invocation.Method.Name.Contains("Init") || invocation.Method.Name.Contains("Start") || invocation.Method.Name.Contains("Stop"))
                return;

            invocation.ReturnValue = invocation.Method.Invoke(ServiceRegistry, invocation.Arguments);
        }
    }
}
